package com.gigi.datageniebackendmaster.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gigi.datageniebackendmaster.common.BaseResponse;
import com.gigi.datageniebackendmaster.model.entity.UserEntity;
import com.gigi.datageniebackendmaster.model.request.LoginRequest;
import com.gigi.datageniebackendmaster.model.request.RegisterRequest;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 用户 服务类
 * </p>
 *
 * @author Gigi
 * @since 2024-07-20
 */
public interface UserService extends IService<UserEntity> {

    /**
     * 注册
     *
     * @param request
     * @return
     */
    BaseResponse<Boolean> register(RegisterRequest request);

    /**
     * 登录
     *
     * @param request
     * @param httpServletRequest
     * @return
     */
    BaseResponse<Boolean> login(LoginRequest request, HttpServletRequest httpServletRequest);

    /**
     * 获取当前用户信息
     *
     * @param httpServletRequest
     * @return
     */
    BaseResponse<UserEntity> currentUser(HttpServletRequest httpServletRequest);

    /**
     * 注销
     *
     * @param httpServletRequest
     * @return
     */
    BaseResponse<Boolean> outLogin(HttpServletRequest httpServletRequest);

}
